package block.exer;

/**
 * Created with IntelliJ IDEA.
 * ClassName: User
 * Package: block.exer
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 * Date: 2023-11-23
 * Time: 19:28
 */

public class User {

    private String userName;

    private String password;

    private long registrationTime; //注册时间

    //构造器
    public User() {
        System.out.println("新用户注册");
        //距离1970-1-1 00:00:00 到现在的毫秒数
        registrationTime = System.currentTimeMillis(); //获取系统当前时间

        userName = System.currentTimeMillis() + "";
        password = "123456";

    }

    public User(String userName, String password) {
        System.out.println("新用户注册");
        registrationTime = System.currentTimeMillis();
        this.userName = userName;
        this.password = password;
    }

    public String getInfo() {
        return "用户名: " + userName + ", 密码: " + password + ", 注册时间: " + registrationTime;
    }


    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        password = password;
    }

    public long getRegistrationTime() {
        return registrationTime;
    }

}
